1 - Basics run¶

Requirements:

  • Files linked via URL.

Objectives:

  1. Read in necessary mass and energy data
  2. Modify necessary values manually and programatically
  3. Generate plots
In [1]:
# if running on google colab, uncomment the next line and execute this cell to install the dependencies and prevent "ModuleNotFoundError" in later cells:
# !pip install git+https://github.com/NREL/PV_ICE.git@development
In [ ]:
import PV_ICE
PV_ICE.__version__
In [ ]:
from google.colab import files
files.upload()
In [ ]:
import os
os.listdir()
In [ ]:
pwd
In [ ]:
testfolder = 'Tuesday'

if not os.path.exists(testfolder):
    os.makedirs(testfolder)
In [ ]:
r1 = PV_ICE.Simulation(name='Sim1', path=testfolder); # Is it possible to define more than one simulation here?
In [ ]:
r1.__dict__
In [ ]:
r1.baselinepath = '/content'
In [ ]:
r1.createScenario(name='standard', massmodulefile=r'baseline_modules_mass_US.csv', energymodulefile = 'baseline_modules_energy.csv' )
In [ ]:
r1.scenario['standard'].addMaterial('glass', massmatfile='/content/baseline_material_mass_glass.csv', energymatfile='/content/baseline_material_energy_glass.csv')
In [ ]:
r1.scenario['standard'].material['glass'].__dict__
In [ ]:
r1.scenario['standard'].material['glass'].matdataIn_m
In [ ]:
r1.calculateMassFlow()
r1.calculateEnergyFlow()
In [ ]:
r1.calculateFlows()
In [8]:
r1.scenario['standard'].dataOut_m.keys()
Out[8]:
Index(['Area', 'Cumulative_Active_Area', 'EOL_BadStatus', 'EOL_Landfill0',
       'EOL_PATHS', 'EOL_PG', 'Effective_Capacity_[W]', 'Landfill_0_ProjLife',
       'MerchantTail_Area', 'MerchantTail_[W]', 'ModuleTotal_MFG', 'P2_stored',
       'P3_reMFG', 'P4_recycled', 'PB1_landfill', 'PB2_stored', 'PB3_reMFG',
       'PB3_reMFG_unyield', 'PB3_reMFG_yield', 'PB4_recycled', 'PG1_landfill',
       'PG2_stored', 'PG3_reMFG', 'PG3_reMFG_unyield', 'PG3_reMFG_yield',
       'PG4_recycled', 'Power_Degraded_[W]', 'Repaired_Area', 'Repaired_[W]',
       'Resold_Area', 'Resold_[W]', 'WeibullParams',
       'Yearly_Sum_Area_EOLby_Degradation', 'Yearly_Sum_Area_EOLby_Failure',
       'Yearly_Sum_Area_EOLby_ProjectLifetime', 'Yearly_Sum_Area_PathsBad',
       'Yearly_Sum_Area_PathsGood', 'Yearly_Sum_Area_atEOL',
       'Yearly_Sum_Power_EOLby_Degradation', 'Yearly_Sum_Power_EOLby_Failure',
       'Yearly_Sum_Power_EOLby_ProjectLifetime', 'Yearly_Sum_Power_PathsBad',
       'Yearly_Sum_Power_PathsGood', 'Yearly_Sum_Power_atEOL',
       'irradiance_stc'],
      dtype='object')

What can aggregate results from dataOut_m and matdataOut_m and compile the data so we can use it more easily

In [9]:
USyearly, UScum = r1.aggregateResults()
# r1.USyearly
# r1.UScum
In [10]:
USyearly.keys()
Out[10]:
Index(['VirginStock_glass_Simulation1_standard_[Tonnes]',
       'VirginStock_silicon_Simulation1_standard_[Tonnes]',
       'VirginStock_Module_Simulation1_standard_[Tonnes]',
       'WasteAll_glass_Simulation1_standard_[Tonnes]',
       'WasteAll_silicon_Simulation1_standard_[Tonnes]',
       'WasteAll_Module_Simulation1_standard_[Tonnes]',
       'WasteEOL_glass_Simulation1_standard_[Tonnes]',
       'WasteEOL_silicon_Simulation1_standard_[Tonnes]',
       'WasteEOL_Module_Simulation1_standard_[Tonnes]',
       'WasteMFG_glass_Simulation1_standard_[Tonnes]',
       'WasteMFG_silicon_Simulation1_standard_[Tonnes]',
       'WasteMFG_Module_Simulation1_standard_[Tonnes]',
       'VirginStock_glass_Simulation1_decadence_[Tonnes]',
       'VirginStock_silicon_Simulation1_decadence_[Tonnes]',
       'VirginStock_Module_Simulation1_decadence_[Tonnes]',
       'WasteAll_glass_Simulation1_decadence_[Tonnes]',
       'WasteAll_silicon_Simulation1_decadence_[Tonnes]',
       'WasteAll_Module_Simulation1_decadence_[Tonnes]',
       'WasteEOL_glass_Simulation1_decadence_[Tonnes]',
       'WasteEOL_silicon_Simulation1_decadence_[Tonnes]',
       'WasteEOL_Module_Simulation1_decadence_[Tonnes]',
       'WasteMFG_glass_Simulation1_decadence_[Tonnes]',
       'WasteMFG_silicon_Simulation1_decadence_[Tonnes]',
       'WasteMFG_Module_Simulation1_decadence_[Tonnes]',
       'newInstalledCapacity_Simulation1_standard_[MW]',
       'newInstalledCapacity_Simulation1_decadence_[MW]',
       'ActiveCapacity_Simulation1_standard_[MW]',
       'DecommisionedCapacity_Simulation1_standard_[MW]',
       'ActiveCapacity_Simulation1_decadence_[MW]',
       'DecommisionedCapacity_Simulation1_decadence_[MW]'],
      dtype='object')
In [11]:
UScum.keys()
Out[11]:
Index(['VirginStock_glass_Simulation1_standard_[Tonnes]',
       'VirginStock_silicon_Simulation1_standard_[Tonnes]',
       'VirginStock_Module_Simulation1_standard_[Tonnes]',
       'WasteAll_glass_Simulation1_standard_[Tonnes]',
       'WasteAll_silicon_Simulation1_standard_[Tonnes]',
       'WasteAll_Module_Simulation1_standard_[Tonnes]',
       'WasteEOL_glass_Simulation1_standard_[Tonnes]',
       'WasteEOL_silicon_Simulation1_standard_[Tonnes]',
       'WasteEOL_Module_Simulation1_standard_[Tonnes]',
       'WasteMFG_glass_Simulation1_standard_[Tonnes]',
       'WasteMFG_silicon_Simulation1_standard_[Tonnes]',
       'WasteMFG_Module_Simulation1_standard_[Tonnes]',
       'VirginStock_glass_Simulation1_decadence_[Tonnes]',
       'VirginStock_silicon_Simulation1_decadence_[Tonnes]',
       'VirginStock_Module_Simulation1_decadence_[Tonnes]',
       'WasteAll_glass_Simulation1_decadence_[Tonnes]',
       'WasteAll_silicon_Simulation1_decadence_[Tonnes]',
       'WasteAll_Module_Simulation1_decadence_[Tonnes]',
       'WasteEOL_glass_Simulation1_decadence_[Tonnes]',
       'WasteEOL_silicon_Simulation1_decadence_[Tonnes]',
       'WasteEOL_Module_Simulation1_decadence_[Tonnes]',
       'WasteMFG_glass_Simulation1_decadence_[Tonnes]',
       'WasteMFG_silicon_Simulation1_decadence_[Tonnes]',
       'WasteMFG_Module_Simulation1_decadence_[Tonnes]',
       'newInstalledCapacity_Simulation1_standard_[MW]',
       'newInstalledCapacity_Simulation1_decadence_[MW]'],
      dtype='object')
In [12]:
r1.saveSimulation()
:) Saved Input and Output Dataframes

Step 5: Use internal plotting functions to plot results¶

From this list, select the one that fits your study and select the type of plotting method. There are various plotting options:

  • plotScenariosComparison
  • plotMaterialComparisonAcrossScenarios
  • plotMetricResults: You can select the following keyword options: 'VirginStock', 'WasteALL', 'WasteEOL', 'WasteMFG'
  • plotMaterialResults
  • plotInstalledCapacityResults

You can also view all the keywords you can use by calling the function without argumnets, or by printing the keys to the module data or the material data

In [13]:
r1.plotScenariosComparison()
Please pass a keyword:

 ** Scenario Data In Mass  ['year', 'new_Installed_Capacity_[MW]', 'mod_eff', 'mod_reliability_t50', 'mod_reliability_t90', 'mod_degradation', 'mod_lifetime', 'mod_MFG_eff', 'mod_Repair', 'mod_MerchantTail', 'mod_EOL_collection_eff', 'mod_EOL_pg0_resell', 'mod_EOL_pg1_landfill', 'mod_EOL_pg2_stored', 'mod_EOL_pg3_reMFG', 'mod_EOL_pg4_recycled', 'mod_EOL_reMFG_yield', 'mod_EOL_sp_reMFG_recycle', 'mod_EOL_pb1_landfill', 'mod_EOL_pb2_stored', 'mod_EOL_pb3_reMFG', 'mod_EOL_pb4_recycled']

 ** Scenario Data Out Mass  ['Area', 'Cumulative_Active_Area', 'EOL_BadStatus', 'EOL_Landfill0', 'EOL_PATHS', 'EOL_PG', 'Effective_Capacity_[W]', 'Landfill_0_ProjLife', 'MerchantTail_Area', 'MerchantTail_[W]', 'ModuleTotal_MFG', 'P2_stored', 'P3_reMFG', 'P4_recycled', 'PB1_landfill', 'PB2_stored', 'PB3_reMFG', 'PB3_reMFG_unyield', 'PB3_reMFG_yield', 'PB4_recycled', 'PG1_landfill', 'PG2_stored', 'PG3_reMFG', 'PG3_reMFG_unyield', 'PG3_reMFG_yield', 'PG4_recycled', 'Power_Degraded_[W]', 'Repaired_Area', 'Repaired_[W]', 'Resold_Area', 'Resold_[W]', 'WeibullParams', 'Yearly_Sum_Area_EOLby_Degradation', 'Yearly_Sum_Area_EOLby_Failure', 'Yearly_Sum_Area_EOLby_ProjectLifetime', 'Yearly_Sum_Area_PathsBad', 'Yearly_Sum_Area_PathsGood', 'Yearly_Sum_Area_atEOL', 'Yearly_Sum_Power_EOLby_Degradation', 'Yearly_Sum_Power_EOLby_Failure', 'Yearly_Sum_Power_EOLby_ProjectLifetime', 'Yearly_Sum_Power_PathsBad', 'Yearly_Sum_Power_PathsGood', 'Yearly_Sum_Power_atEOL', 'irradiance_stc']
In [14]:
r1.plotMaterialComparisonAcrossScenarios(material='silicon', keyword='mat_virgin_eff')
In [15]:
r1.plotMaterialResults(keyword='VirginStock')
In [16]:
r1.plotMetricResults()
[]
In [17]:
r1.plotInstalledCapacityResults()
[]
In [ ]: